package com.gxc.mq;

import com.alibaba.fastjson.JSON;
import com.gxc.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * @author GongXincheng
 * @since 2019-08-27 13:50
 */
@Slf4j
@Component
public class Demo0_Consumer {

    @RabbitListener(queues = "${gxc.queue.hello}")
    public void consumer(User user) {
        log.info("consumer 0000 get message：" + JSON.toJSONString(user));
        System.out.println("user -> " + JSON.toJSONString(user));
        System.out.println("aaaaa");
    }

}
